#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s;
    cin >> s;
    bool hash[10] = { 0 };

    for (int i = s.size() - 1; i >= 0; i--)
    {
        if (hash[s[i] - '0'] == false)
        {
            cout << s[i];
            hash[s[i] - '0'] = true;
        }
    }

    return 0;
}